Skip to content

Launcher for injecting loader without Steam#66

Draft
Pizzabelly wants to merge 1 commit into
Fexty12573:masterfrom
Pizzabelly:launcher-exe
Draft

Launcher for injecting loader without Steam#66
Pizzabelly wants to merge 1 commit into
Fexty12573:masterfrom
Pizzabelly:launcher-exe

Conversation

@Pizzabelly
Copy link
Copy Markdown
Contributor

This serves as an alternative way to get a DLL loaded early enough for all of the hooking in the loader to work, as discussed in #63. It uses the common1 CreateRemoteThread() with the address of LoadLibraryA() DLL injection method. With the adjustment of calling CreateProcessA() with CREATE_SUSPENDED then ResumeThread() after the injection. I figure this is safer and more predictable, especially because we want the DLL injected before the process starts.

The launcher code is made to be compatible with /NODEFAULTLIB (IgnoreAllDefaultLibraries in the vcproj) in order to minimize the exe size. Which comes out to ~9.5KB and about half of that is for the 32x32 icon.

I've tested this on Windows 11 and Proton 11.0. It can either be run manually from the MonsterHunterWorld.exe folder or as a Steam launch option.

It could also be utilized to load an arbitrary DLL as the loader, like SharpPluginLoader.dll. That would require using the launcher, though. Which is bad for the most common case of Windows + Steam.

Windows (%command% is only there to make Steam not ignore the launch command):

C:\windows\system32\cmd.exe /c SPLLauncher.exe %command%

Linux/Proton:

export CMD=$(echo -n "%command%" | sed "s/\/MonsterHunterWorld.exe/\/SPLLauncher.exe/") && WINEDLLOVERRIDES="winmm,dinput8=n,b" eval $CMD

Footnotes

  1. https://en.wikipedia.org/wiki/DLL_injection (Entry 3 in 'Approaches on Microsoft Windows')

@Pizzabelly
Copy link
Copy Markdown
Contributor Author

I fixed including the icon in the solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant